package com.itany.book.service.impl;

import com.itany.book.mapper.PressMapper;
import com.itany.book.pojo.Press;
import com.itany.book.service.PressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Author:yaozhiyuan0117@163.com
 * Time:2019/12/30 17:03
 * Describe:
 * version:1.0
 */

@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class PressServiceImpl implements PressService {

    @Autowired
    private PressMapper pressMapper;

    @Override
    @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
    public List<Press> findAll() {
        return pressMapper.selectAll();
    }
}
